Skip to content

Add try_from_slice() and try_from_mut_slice()#117

Closed
peterkelly wants to merge 2 commits intofizyk20:masterfrom
peterkelly:try-from-slice
Closed

Add try_from_slice() and try_from_mut_slice()#117
peterkelly wants to merge 2 commits intofizyk20:masterfrom
peterkelly:try-from-slice

Conversation

@peterkelly
Copy link

@peterkelly peterkelly commented May 7, 2021

Add two new methods for creating a GenericArray reference from a slice in situations where the caller doesn't know the length of the incoming slice. In such a situation, these methods are safer than from_slice() and from_mut_slice() because they don't panic.

@novacrazy novacrazy mentioned this pull request Mar 29, 2023
Merged
2 tasks
@fjarri
Copy link
Contributor

fjarri commented Aug 4, 2023

I think it would be even more convenient as a TryFrom<&[u8]> impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants